<link href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}" rel="stylesheet" type="text/css">
<link rel='stylesheet' href='${rc.getContextPath()}/manage/styles/colorPicker/spectrum.css' />
<style>
.dataPick span.error {
    position: absolute !important;
    left: 151px;
}

.sp-dd {
    background:
        url("${rc.getContextPath()}/manage/styles/dwz/themes/default/images/button/imgX.png");
    background-position: -163px -1px;
    height: 18px;
    width: 16px;
    position: absolute;
    right: 0px;
    top: 0px;
    border: 1px solid #D9DFE5;
}

.sp-replacer {
    padding: 0px;
    border: 0px !important;
    background: #EDF4F5 none repeat scroll 0% 0%;
    width: 146px;
    height: 24px;
    position: relative;
}

.sp-replacer.sp-active {
    border-color: #289BE5;
}

.sp-container,.sp-palette-container {
    border-color: #BDD7E7;
}

.sp-input {
    border: 1px solid #D9DFE5;
}

.sp-preview {
    width: 127px;
    height: 22px;
    border: 1px solid #D9DFE5;
    margin: 0px;
}
</style>
<form method="post" action="${rc.getContextPath()}/manage/workDayType/saveWorkDayType" class=" pageForm required-validate" onsubmit="return workDayTypeJs._tsubmit(this);">
    <div class="pageContent">
        <div class="pageFormContent">
            <fieldset>
                <input type="hidden" name="navTabId" value="${navTabId!''}"> <input type="hidden" name="id" value="<#if (workDayType.dayTypeCode)??>${workDayType.dayTypeCode!''}</#if>">
                <dl>

                    <dt><@label key="dayTypeCode.C,colon">工作日类型编号：</@label></dt>
                    <dd>
                        <input class="required  alphanumeric toUp" name="dayTypeCode" value="<#if (workDayType.dayTypeCode)??>${workDayType.dayTypeCode!''}</#if>" type="text" maxlength="40" readonly/>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="dayTypeText.C,colon">工作日类型描述：</@label></dt>
                    <dd>
                        <input readonly class="required" name="dayTypeText" value="<#if (workDayType.dayTypeText)??>${workDayType.dayTypeText!''}</#if>" type="text" maxlength="60" />
                    </dd>
                </dl>

                <dl>
                    <dt><@label key="displayColor.C,colon">显示颜色：</@label></dt>
                    <dd>
                        <input readonly type='text' id="colorPicker" name="displayColor" value="${workDayType.displayColor!'#FF0000'}" />
                    </dd>
                </dl>
                <dl>
                    <dd>
                        <label><input disabled type="checkbox" name="lockFlag" value="1"<#if (defect.lockFlag)?? && (defect.lockFlag == 1)> checked="true"</#if>><@label key="lockFlag.C">锁定标记</@label></label>
                    </dd>
                </dl>
                <dl class="nowrap">
                    <dd>

                        <div class="panel" currentIndex="0" eventType="click" style="width: 605px; margin: 0;">
                            <h1><@label key="workDayPeriod.C">工作时段</@label></h1>
                            <div>
                                <table id="periodTable" class="table border canopration" width="600px" layoutH="275">
                                    <thead>
                                            <tr>        
                                               <th width="50"><@label key="serialNumber.C">序号</@label></th>
                                                <th width="200" ><@label key="startTime.C">开始时间</@label></th>
                                                <th width="200"><@label key="endTime.C">结束时间</@label></th>
                                                <th width="80"><@label key="spanDays.C">跨天</@label></th>
                                                <th width="80"><@label key="nextDay.C">下一天</@label></th>
                                            </tr>
                                        </thead>
                                        <tbody id="periodTbody">
                                            <#if workDayType.periods??&&(workDayType.periods?size>0) >
                                            <#list workDayType.periods as period>
                                            <tr style='height:30px'>
                                              <td>
                                            ${period.ordinal!''}
                                            </td>
                                            <td>
                                            ${period.startTime!''}
                                            </td>
                                            <td style='position: relative;' class='dataPick'>
                                            ${period.endTime!''}
                                            </td>
                                            <td> 
                                            <#if (period.spanDaysFlag == 1)><@label key="yes.C">是</@label><#else><@label key="no.C">否</@label></#if>
                                            </td>
                                            <td >
                                            <#if (period.nextDayFlag == 1)><@label key="yes.C">是</@label><#else><@label key="no.C">否</@label></#if>
                                            </td>
                                            
                                        </#list>
                                         </#if>
                                        </tbody>
                                    </table>
                            </div>
                        </div>
                    </dd>
                </dl>
            </fieldset>
        </div>
        <#if (workDayType.dayTypeCode)??> <#assign createInfo=workDayType/> <#include "/common/createInfo.html"> </#if>
        <div class="formBar">
            <ul>
                    <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="button" class="close"><@label key="close.B">关闭</@label></button>
                        </div>
                    </div></li>
            </ul>
        </div>
    </div>
</form>



<script type="text/javascript">
    $(function() {
        var dialog = $.pdialog.getCurrent();
        var colorPicker = $("#colorPicker", dialog);
        var colorVal = colorPicker.val();
        var colorOption = {
            color : colorVal,
            chooseText : "<@label key='select.C'>选择</@label>",
            cancelText : "<@label key='cancel.B'>取消</@label>",
            showInput : true,
            preferredFormat : "hex",
            showInput : true,
            showPalette : true,
            palette : [
                    [ "#000", "#444", "#666", "#999", "#ccc", "#eee",
                            "#f3f3f3", "#fff" ],
                    [ "#f00", "#f90", "#ff0", "#0f0", "#0ff", "#00f", "#90f",
                            "#f0f" ],
                    [ "#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "#d0e0e3",
                            "#cfe2f3", "#d9d2e9", "#ead1dc" ],
                    [ "#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9",
                            "#9fc5e8", "#b4a7d6", "#d5a6bd" ],
                    [ "#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af",
                            "#6fa8dc", "#8e7cc3", "#c27ba0" ],
                    [ "#c00", "#e69138", "#f1c232", "#6aa84f", "#45818e",
                            "#3d85c6", "#674ea7", "#a64d79" ],
                    [ "#900", "#b45f06", "#bf9000", "#38761d", "#134f5c",
                            "#0b5394", "#351c75", "#741b47" ],
                    [ "#600", "#783f04", "#7f6000", "#274e13", "#0c343d",
                            "#073763", "#20124d", "#4c1130" ] ]
        };
        if (!colorPicker.spectrum) {
            var ctx = '${rc.getContextPath()}';
            $.getScript(ctx + '/styles/colorPicker/spectrum.js', function() {
                //初始化颜色选择器
                colorPicker.spectrum(colorOption);
            });
        } else {
            colorPicker.spectrum(colorOption);
        }
        $('.sp-dd', dialog).empty();
    });

    
</script>
